package comparableinterface;

public class SortRectangles {
  public static void main(String[] args) {
    ComparableRectangle[] rectangles = {
      new ComparableRectangle(3.4, 5.4),
      new ComparableRectangle(13.24, 55.4),
      new ComparableRectangle(7.4, 35.4),
      new ComparableRectangle(1.4, 25.4)};
    java.util.Arrays.sort(rectangles);
    for (Rectangle rectangle: rectangles) {
      System.out.print(rectangle + " "); 
      System.out.println();
    }

    System.out.println();

    ComparableCircle[] rectangles2 = {
            new ComparableCircle(10.2),
            new ComparableCircle(3.6),
            new ComparableCircle(16.8),
            new ComparableCircle(8.3)};
    java.util.Arrays.sort(rectangles2);
    for (Circle circle: rectangles2) {
      System.out.print(circle + " ");
      System.out.println();
    }
  }
}

